# coding=utf-8
import socket


def main():
    # 创建套接字
    udp_socket = socket(socket.AF_INET, socket.SOCK_DGRAM)
    # 设置绑定端口
    bind_port = ('', 8848)
    # 1024表示缓冲区大小
    recv_data = udp_socket.recvfrom(1024)
    print(recv_data[0].decode('gbk'))
    # 关闭套接字
    udp_socket.close()


if __name__ == '__main__':
    main()
